package cby.plugin.check.util;

/**
 * value的信息
 */
class FileUtils {

    static void writeObject(HashMap<String,String> map, String fileName) {

        try {
            File fileDir = new File("ResourcesError")
            if(!fileDir.exists()){
                fileDir.mkdir()
            }
            FileOutputStream outStream = new FileOutputStream("ResourcesError" +File.separator + fileName)

            OutputStreamWriter objectOutputStream = new OutputStreamWriter(outStream,"utf-8")

            for (String value : map.values()) {
                objectOutputStream.write(value+"\t\n")
                println(fileName+ ':' + value)
            }
            println("save successful")
            objectOutputStream.flush()
            outStream.flush()
            outStream.close()
        } catch (FileNotFoundException e) {

            e.printStackTrace()

        } catch (IOException e) {

            e.printStackTrace()

        }

    }
}